package com.tevintao.marketingsystem.tool;

/**
 * Created by tevintao on 2016/4/27.
 */
public class ShellOperationTool {
    private static final String back_command = "input keyevent 4";
    private static final String home_command = "input keyevent 3";
    private static final String key_enter = "input keyevent 66 ";
    private static final String reboot = "reboot";

    public static void goBack() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                SystemPathTool.noResultIsSuccess(back_command);
            }
        }).start();
    }

    public static void goSyncBack() {
        SystemPathTool.noResultIsSuccess(back_command);
    }

    public static void goAndroidHome() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                SystemPathTool.noResultIsSuccess(home_command);
            }
        }).start();
    }


    public static void reBoot() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                SystemPathTool.noResultIsSuccess(reboot);
            }
        }).start();
    }

    public static void inputKeyEvent() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                SystemPathTool.noResultIsSuccess(key_enter);
            }
        }).start();
    }
}
